from django.db import models

from user.models import User


class Resume(models.Model):
    title = models.CharField('简历标题', max_length=50)
    public = models.BooleanField('是否公开', help_text='{0:私有, 1:公开}')
    name = models.CharField('姓名', null=True, max_length=50)
    sex = models.NullBooleanField('性别', help_text='{0:女, 1:男}')
    birth = models.DateField('生日', null=True)
    begin_work = models.DateField('参加工作时间', null=True)
    email = models.EmailField('邮箱', null=True)
    phone = models.CharField('手机号码', null=True, max_length=11)
    job_status = models.SmallIntegerField('求职状态', null=True, help_text='{0:离职-随时到岗, 1:在职-暂不考虑, 2:在职-考虑机会, 3:在职-月内到岗}')
    advantage = models.TextField('个人优势', null=True)
    created_time = models.DateTimeField('创建时间', auto_now_add=True)
    updated_time = models.DateTimeField('更新时间', auto_now=True)

    # 外键
    user = models.ForeignKey(User, on_delete=models.CASCADE)
